﻿using System;

namespace OpenWaves.EPiServer.ImageProperty
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    public sealed class ImageSettingsAttribute : Attribute
    {
        public static readonly string[] ImageExtensions = new[] { "jpg", "jpeg", "jpe", "ico", "gif", "bmp", "png" };

        public int Width { get; private set; }

        public int Height { get; private set; }

        public Type[] SupportedMediaTypes { get; private set; }

        public ImageSettingsAttribute(int width, int height, params Type[] supportedMediaTypes)
        {
            this.Width = width;
            this.Height = height;
            this.SupportedMediaTypes = supportedMediaTypes;
        }

        public ImageSettingsAttribute(params Type[] supportedMediaTypes)
        {
            this.Width = -1;
            this.Height = -1;
            this.SupportedMediaTypes = supportedMediaTypes;
        }
    }
}